<template>
  <div class="home">
    <el-container>

      <!-- 侧边导航栏 -->
      <Aside :myparent="isCollapse"></Aside>

      <el-container class="container">

        <!-- 头部 -->
        <Header @parentevent="handleEvent"></Header>

        <!-- 主体内容 -->
        <el-main>
          <router-view/>
        </el-main>

      </el-container>
    </el-container>
  </div>
</template>

<script>
import Header from '@/components/Header.vue';
import Aside from '@/components/Aside.vue';
  export default{
    components: {
      Header,
      Aside
    },
    data() {
      return {
        isCollapse: null

        // editableTabsValue: '1',
        // editableTabs: [{
        //   title: '首页',
        //   name: '1',
        //   path:'/home/index'
        // }],
        // tabIndex: 1,
      }
    },
    methods: {
      handleEvent(isCollapse){
        isCollapse = !isCollapse
        this.isCollapse = isCollapse
      }
      // addTab(targetName,title,path) {
      //   let newTabName = ++this.tabIndex + '';
      //   this.editableTabs.push({
      //     title,
      //     name: newTabName,
      //     path
      //   });
      //   this.editableTabsValue = newTabName;
      // },
      // removeTab(targetName) {
      //   let tabs = this.editableTabs;
      //   let activeName = this.editableTabsValue;
      //   if (activeName === targetName) {
      //     tabs.forEach((tab, index) => {
      //       if (tab.name === targetName) {
      //         let nextTab = tabs[index + 1] || tabs[index - 1];
      //         if (nextTab) {
      //           activeName = nextTab.name;
      //         }
      //       }
      //     });
      //   }
        
      //   this.editableTabsValue = activeName;
      //   this.editableTabs = tabs.filter(tab => tab.name !== targetName);
      // }
    },
   
  }
</script>

<style scoped lang="scss">
.container{
  display: block;
  height: 100vh;
  overflow-y: scroll;
}
// .container::-webkit-scrollbar{
//   display: none;
// }

</style>

